<?php

namespace Application\controller;

use Application\model\ChannelModel;
use Cola\Controller;

class ChannelController extends Controller
{
    /**
     * 获取玩家信息
     * @return void
     */
    public function getRoleInfo()
    {
        $this->result($this->model('Player')->getRoleInfo());
    }

    /**
     * 获取区服列表
     * @return void
     */
    public function getServers()
    {
        $this->result($this->model('Player')->getServers());
    }

    /**
     * 封禁玩家
     * @return void
     */
    public function banPlayer()
    {
        $this->result($this->model('Player')->banPlayer());
    }

    /**
     * 解封禁玩家
     * @return void
     */
    public function unbanPlayer()
    {
        $this->result($this->model('Player')->unbanPlayer());
    }

    /**
     * 封禁玩家发言
     * @return void
     */
    public function banChat()
    {
        $this->result($this->model('Player')->banChat());
    }

    /**
     * 解封禁玩家发言
     * @return void
     */
    public function unbanChat()
    {
        $this->result($this->model('Player')->unbanChat());
    }

    /**
     * 解封禁玩家发言
     * @return void
     */
    public function kickOut()
    {
        $this->result($this->model('Player')->kickOut());
    }

    public function notifyServer()
    {
        $this->result($this->model('Player')->notifyServer());
    }

    public function syncChat()
    {
        $this->result($this->model('Player')->syncChat());
    }


    public function result($data)
    {
        exit(json_encode($data));
    }

    public function config(){
        $ChannelModel = new ChannelModel();
        $this->success($ChannelModel->getChannelInfoByCid(CID,'hotupdate_path,version'));
    }
    
}